Skip to content

Enable hypeman to run inside of hypeman#141

Merged
sjmiller609 merged 7 commits into
mainfrom
codex/pr-124
Mar 9, 2026
Merged

Enable hypeman to run inside of hypeman#141
sjmiller609 merged 7 commits into
mainfrom
codex/pr-124

Conversation

@sjmiller609

@sjmiller609 sjmiller609 commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

Experiment Summary

Goal

Validate whether Hypeman can run inside a Hypeman VM, and then go one level deeper (Hypeman inside Hypeman inside Hypeman) and still launch nginx.

What Was Tested

  • Hypervisor: cloud-hypervisor
  • Started L1 Hypeman host VM in systemd mode (Ubuntu image), increased to 8GB.
  • Installed Hypeman in nested VM(s).
  • Attempted multi-level nested launches.
  • Verified deepest-level nginx by HTTP curl response.

High-Level Results

  • Hypeman -> VM -> Hypeman worked.
  • Hypeman -> VM -> Hypeman -> VM (nginx) also worked.
  • Deepest nginx returned HTML successfully (<!DOCTYPE html> ...), confirming 3-level nesting path is functional.

Key Finding

  • The installed Hypeman (v0.0.7) in nested VM used kernel ch-6.12.8-kernel-1.4-202602101 and failed networking setup (iptables masquerade rule), causing service restart loops.
  • Running a custom Hypeman binary using kernel ch-6.12.8-kernel-1.5-202603091 resolved that nested networking issue and enabled successful deep nesting.

Conclusion

Your kernel 1.5 netfilter/iptables changes are sufficient to make nested Hypeman networking work; the remaining blocker is older installed Hypeman/kernel selection behavior in nested environments, not the kernel capability itself.


Note

Medium Risk
Changes the default kernel used for new instances, which can affect VM boot/runtime behavior and networking compatibility. The code change is small but impacts a core runtime dependency via new download/header URLs.

Overview
Updates kernel version management to add Kernel_202603091 (Cloud Hypervisor kernel 1.5) and marks it as the new DefaultKernelVersion.

Extends SupportedKernelVersions, KernelDownloadURLs, and KernelHeaderURLs to include the new kernel artifacts, and re-labels Kernel_202602101 as the previous default.

Written by Cursor Bugbot for commit a091844. This will update automatically on new commits. Configure here.

Hypeship Agent and others added 7 commits March 6, 2026 23:05
Two iptables compatibility fixes for environments where the kernel
doesn't have all modules loaded (e.g. minimal nested-VM kernels like
the Hypeman dev VM itself):

1. Remove -m comment/--comment from NAT MASQUERADE rule: the xt_comment
   module is absent in the custom ch-6.12.8+ kernel. The comment is
   cosmetic only; the rule works fine without it.

2. Downgrade FORWARD rule failures from fatal to warning: the filter
   table doesn't exist in this kernel (only nat is available). When the
   filter table is missing, the kernel default policy applies and
   forwarding still works. Hypeman now warns and continues rather than
   refusing to start.

3. Update isForwardRuleCorrect to match by position+interfaces instead
   of relying solely on comment strings.

These changes allow hypeman to run fully in nested-VM dev environments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Documents the full setup process for AI agents running inside a Hypeman
VM: Go install, erofs-utils/dnsmasq extraction without sudo, permission
bootstrap via the outer hypeman exec API, build steps, config, server
startup, VM launching, and the nested-VM iptables quirks discovered
during actual setup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The previous fix removed -m comment from all iptables rules to work around
the missing xt_comment module on nested-VM kernels. This broke two things
identified in PR review:

1. deleteNATRuleByComment / deleteForwardRuleByComment searched for comment
   strings to find stale rules on config changes (uplink/interface changes).
   Without comments in rules, they found nothing, so stale rules accumulated.

2. lastHypemanForwardRulePosition searched for "hypeman-" comments to find
   hypeman's FORWARD rules. Without comments, it always returned 0, causing
   Docker's jump to be inserted at position 1 (before hypeman's rules) and
   duplicate rule insertion on restart.

Fix: probe xt_comment availability once at startup via probeXTComment()
(cached in manager via sync.Once). Then:

- Use -m comment in rules when the kernel supports xt_comment; omit otherwise
- deleteNATRule: matches by comment OR (MASQUERADE + source subnet) — handles
  both kernel types and upgrades/transitions between them
- deleteForwardRule: matches by comment OR in/out interface pair — same logic
- lastHypemanForwardRulePosition: matches by "hypeman-" comment OR bridge
  interface name as fallback for comment-less kernels

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sjmiller609 sjmiller609 marked this pull request as ready for review March 9, 2026 20:44
@sjmiller609 sjmiller609 merged commit 2e16427 into main Mar 9, 2026
7 checks passed
@sjmiller609 sjmiller609 deleted the codex/pr-124 branch March 9, 2026 20:44

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated risk assessment for this PR:

  • Risk level: Medium-High
  • Why: The diff changes lib/system/versions.go to bump the default kernel and adds new kernel/header download URLs. This is a system-level runtime default change with infrastructure/operational blast radius (all new instances pick up a new kernel), even though the diff is small and single-file.
  • Code review required: Yes (medium-or-higher risk)
  • Codeowners-required check: No CODEOWNERS file detected in this repo.
  • Approval decision: Not approved by automation (medium-high risk is not auto-approvable).

Note: this PR is already in MERGED state, so reviewer assignment and approval gating cannot be applied retroactively on this run.


Open in Web View Automation 

@cursor cursor Bot requested review from hiroTamada and rgarcia March 9, 2026 20:46

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated risk assessment for this PR:

  • Risk level: Medium-High
  • Why: The diff updates lib/system/versions.go to bump the default kernel and add new kernel/header download URLs. This is an infrastructure/runtime default change with meaningful operational blast radius for new instances.
  • Code review required: Yes (medium-or-higher risk)
  • Codeowners-required check: No CODEOWNERS file detected in this repo.
  • Reviewer assignment: Requested hiroTamada and rgarcia (max 2).
  • Approval decision: Not approved by automation (policy: medium-high risk is not auto-approvable).

Note: PR state is MERGED, so these review requests are non-blocking and recorded for audit/follow-up rather than merge gating.


Open in Web View Automation 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant